<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/*
<span class='line'>  2</span>  * Copyright (C) 2008, 2009 Mihai Şucan
<span class='line'>  3</span>  *
<span class='line'>  4</span>  * This file is part of PaintWeb.
<span class='line'>  5</span>  *
<span class='line'>  6</span>  * PaintWeb is free software: you can redistribute it and/or modify
<span class='line'>  7</span>  * it under the terms of the GNU General Public License as published by
<span class='line'>  8</span>  * the Free Software Foundation, either version 3 of the License, or
<span class='line'>  9</span>  * (at your option) any later version.
<span class='line'> 10</span>  *
<span class='line'> 11</span>  * PaintWeb is distributed in the hope that it will be useful,
<span class='line'> 12</span>  * but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class='line'> 13</span>  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
<span class='line'> 14</span>  * GNU General Public License for more details.
<span class='line'> 15</span>  *
<span class='line'> 16</span>  * You should have received a copy of the GNU General Public License
<span class='line'> 17</span>  * along with PaintWeb.  If not, see &lt;http://www.gnu.org/licenses/>.
<span class='line'> 18</span>  *
<span class='line'> 19</span>  * $URL: http://code.google.com/p/paintweb $
<span class='line'> 20</span>  * $Date: 2009-07-02 15:37:38 +0300 $
<span class='line'> 21</span>  */</span><span class="WHIT">
<span class='line'> 22</span> 
<span class='line'> 23</span> </span><span class="COMM">/**
<span class='line'> 24</span>  * @author &lt;a lang="ro" href="http://www.robodesign.ro/mihai">Mihai Şucan&lt;/a>
<span class='line'> 25</span>  * @fileOverview Holds the color picker implementation.
<span class='line'> 26</span>  */</span><span class="WHIT">
<span class='line'> 27</span> 
<span class='line'> 28</span> </span><span class="COMM">/**
<span class='line'> 29</span>  * @class The color picker tool.
<span class='line'> 30</span>  *
<span class='line'> 31</span>  * @param {PaintWeb} app Reference to the main paint application object.
<span class='line'> 32</span>  */</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="NAME">pwlib.tools.cpicker</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">app</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_self</span><span class="WHIT">        </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT">      </span><span class="NAME">colormixer</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">app.extensions.colormixer</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">      </span><span class="NAME">context</span><span class="WHIT">      </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">app.layer.context</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT">      </span><span class="NAME">gui</span><span class="WHIT">          </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">app.gui</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT">      </span><span class="NAME">lang</span><span class="WHIT">         </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">app.lang</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT">      </span><span class="NAME">MathRound</span><span class="WHIT">    </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.round</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT">      </span><span class="NAME">mouse</span><span class="WHIT">        </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">app.mouse</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 41</span> 
<span class='line'> 42</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 43</span>    * Holds the ID of the previously active tool. Once the user completes the 
<span class='line'> 44</span>    * color picking operation, the previous tool is activated.
<span class='line'> 45</span>    *
<span class='line'> 46</span>    * @private
<span class='line'> 47</span>    * @type String
<span class='line'> 48</span>    */</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">prevTool</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 50</span> 
<span class='line'> 51</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 52</span>    * Holds a reference to the target color input. This is a GUI color input 
<span class='line'> 53</span>    * component.
<span class='line'> 54</span>    *
<span class='line'> 55</span>    * @private
<span class='line'> 56</span>    * @type pwlib.guiColorInput
<span class='line'> 57</span>    */</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">targetInput</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span> 
<span class='line'> 60</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 61</span>    * Holds the previous color values - before the user started picking 
<span class='line'> 62</span>    * a different color.
<span class='line'> 63</span>    *
<span class='line'> 64</span>    * @private
<span class='line'> 65</span>    * @type Object
<span class='line'> 66</span>    */</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">prevColor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 68</span> 
<span class='line'> 69</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 70</span>    * Tells if the color mixer is active for the current target input.
<span class='line'> 71</span>    *
<span class='line'> 72</span>    * @private
<span class='line'> 73</span>    * @type Boolean
<span class='line'> 74</span>    */</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">colormixerActive</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span> 
<span class='line'> 77</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 78</span>    * Tells if the current color values are accepted by the user. This value is 
<span class='line'> 79</span>    * used by the tool deactivation code.
<span class='line'> 80</span>    *
<span class='line'> 81</span>    * @private
<span class='line'> 82</span>    * @type Boolean
<span class='line'> 83</span>    */</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">colorAccepted</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 85</span> 
<span class='line'> 86</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 87</span>    * The &lt;code>preActivate&lt;/code> event handler. This method checks if the 
<span class='line'> 88</span>    * browser implements the &lt;code>getImageData()&lt;/code> context method. If not, 
<span class='line'> 89</span>    * the color picker tool cannot be used.
<span class='line'> 90</span>    */</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT">  </span><span class="NAME">this.preActivate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT">    </span><span class="COMM">// The latest versions of all browsers which implement Canvas, also </span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT">    </span><span class="COMM">// implement the getImageData() method. This was only a problem with some </span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT">    </span><span class="COMM">// old versions (eg. Opera 9.2).</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">context.getImageData</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT">      </span><span class="NAME">alert</span><span class="PUNC">(</span><span class="NAME">lang.errorCpickerUnsupported</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 99</span> 
<span class='line'>100</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">app.tool</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">app.tool._id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT">      </span><span class="NAME">prevTool</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">app.tool._id</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>103</span> 
<span class='line'>104</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>106</span> 
<span class='line'>107</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>108</span>    * The &lt;code>activate&lt;/code> event handler. This method determines the current 
<span class='line'>109</span>    * target input in the Color Mixer, if any. Canvas shadow rendering is 
<span class='line'>110</span>    * disallowed.
<span class='line'>111</span>    */</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT">  </span><span class="NAME">this.activate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT">    </span><span class="COMM">// When the color mixer panel is active, the color picker uses the same </span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT">    </span><span class="COMM">// target input.</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">colormixer</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">colormixer.targetInput</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT">      </span><span class="NAME">targetInput</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">gui.colorInputs</span><span class="PUNC">[</span><span class="NAME">colormixer.targetInput.id</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>118</span> 
<span class='line'>119</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">targetInput</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT">      </span><span class="NAME">gui.statusShow</span><span class="PUNC">(</span><span class="STRN">'cpicker_'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">targetInput.id</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT">      </span><span class="NAME">gui.statusShow</span><span class="PUNC">(</span><span class="STRN">'cpickerNormal'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>124</span> 
<span class='line'>125</span> </span><span class="WHIT">    </span><span class="NAME">app.shadowDisallow</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>127</span> 
<span class='line'>128</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>129</span>    * The &lt;code>deactivate&lt;/code> event handler. This method allows shadow 
<span class='line'>130</span>    * rendering again, and resets the color input values if the user did not 
<span class='line'>131</span>    * accept the new color.
<span class='line'>132</span>    */</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT">  </span><span class="NAME">this.deactivate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">colorAccepted</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">targetInput</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">prevColor</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT">      </span><span class="NAME">updateColor</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>137</span> 
<span class='line'>138</span> </span><span class="WHIT">    </span><span class="NAME">app.shadowAllow</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>140</span> 
<span class='line'>141</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>142</span>    * The &lt;code>mousedown&lt;/code> event handler. This method starts the color 
<span class='line'>143</span>    * picking operation.
<span class='line'>144</span>    *
<span class='line'>145</span>    * @param {Event} ev The DOM Event object.
<span class='line'>146</span>    */</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT">  </span><span class="NAME">this.mousedown</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ev</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT">    </span><span class="COMM">// We check again, because the user might have opened/closed the color </span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT">    </span><span class="COMM">// mixer.</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">colormixer</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">colormixer.targetInput</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT">      </span><span class="NAME">targetInput</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">gui.colorInputs</span><span class="PUNC">[</span><span class="NAME">colormixer.targetInput.id</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>153</span> 
<span class='line'>154</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">targetInput</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT">      </span><span class="NAME">colormixerActive</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT">      </span><span class="NAME">gui.statusShow</span><span class="PUNC">(</span><span class="STRN">'cpicker_'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">targetInput.id</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT">      </span><span class="NAME">colormixerActive</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT">      </span><span class="NAME">gui.statusShow</span><span class="PUNC">(</span><span class="STRN">'cpickerNormal'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>160</span> 
<span class='line'>161</span> </span><span class="WHIT">      </span><span class="COMM">// The context menu (right-click). This is unsupported by Opera.</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT">      </span><span class="COMM">// Also allow Shift+Click for changing the stroke color (making it easier for Opera users).</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ev.button</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">ev.shiftKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT">        </span><span class="NAME">targetInput</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">gui.colorInputs.strokeStyle</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT">        </span><span class="NAME">targetInput</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">gui.colorInputs.fillStyle</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>167</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>169</span> 
<span class='line'>170</span> </span><span class="WHIT">    </span><span class="NAME">updatePrevColor</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>171</span> 
<span class='line'>172</span> </span><span class="WHIT">    </span><span class="NAME">_self.mousemove</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">updateColor</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT">    </span><span class="NAME">updateColor</span><span class="PUNC">(</span><span class="NAME">ev</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>174</span> 
<span class='line'>175</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>177</span> 
<span class='line'>178</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>179</span>    * Perform color update. This function updates the target input or the Color 
<span class='line'>180</span>    * Mixer to hold the color value under the mouse - it actually performs the 
<span class='line'>181</span>    * color picking operation.
<span class='line'>182</span>    *
<span class='line'>183</span>    * &lt;p>This function is also the &lt;code>mousemove&lt;/code> event handler for this 
<span class='line'>184</span>    * tool.
<span class='line'>185</span>    *
<span class='line'>186</span>    * @param {Event} ev The DOM Event object.
<span class='line'>187</span>    * @param {Boolean} [usePrevColor=false] Tells the function to use the 
<span class='line'>188</span>    * previous color values we have stored. This is used when the user cancels 
<span class='line'>189</span>    * the color picking operation.
<span class='line'>190</span>    */</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">  </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">updateColor</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ev</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">usePrevColor</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">targetInput</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>195</span> 
<span class='line'>196</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">usePrevColor</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">prevColor</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT">              </span><span class="NAME">context.getImageData</span><span class="PUNC">(</span><span class="NAME">mouse.x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mouse.y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT">        </span><span class="NAME">color</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT">          </span><span class="NAME">red</span><span class="PUNC">:</span><span class="WHIT">    </span><span class="NAME">p.data</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">255</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT">          </span><span class="NAME">green</span><span class="PUNC">:</span><span class="WHIT">  </span><span class="NAME">p.data</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">255</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT">          </span><span class="NAME">blue</span><span class="PUNC">:</span><span class="WHIT">   </span><span class="NAME">p.data</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">255</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT">          </span><span class="NAME">alpha</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">p.data</span><span class="PUNC">[</span><span class="NUMB">3</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">255</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toFixed</span><span class="PUNC">(</span><span class="NUMB">3</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>204</span> 
<span class='line'>205</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">colormixerActive</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT">      </span><span class="NAME">colormixer.color.red</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">color.red</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT">      </span><span class="NAME">colormixer.color.green</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">color.green</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT">      </span><span class="NAME">colormixer.color.blue</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">color.blue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>209</span> </span><span class="WHIT">      </span><span class="NAME">colormixer.color.alpha</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">color.alpha</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT">      </span><span class="NAME">colormixer.update_color</span><span class="PUNC">(</span><span class="STRN">'rgb'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>211</span> 
<span class='line'>212</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT">      </span><span class="NAME">targetInput.updateColor</span><span class="PUNC">(</span><span class="NAME">color</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>216</span> 
<span class='line'>217</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>218</span>    * The &lt;code>mouseup&lt;/code> event handler. This method completes the color 
<span class='line'>219</span>    * picking operation, and activates the previous tool.
<span class='line'>220</span>    *
<span class='line'>221</span>    * &lt;p>The {@link pwlib.appEvent.configChange} application event is also 
<span class='line'>222</span>    * dispatched for the configuration property associated to the target input.
<span class='line'>223</span>    *
<span class='line'>224</span>    * @param {Event} ev The DOM Event object.
<span class='line'>225</span>    */</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT">  </span><span class="NAME">this.mouseup</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ev</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">targetInput</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>230</span> 
<span class='line'>231</span> </span><span class="WHIT">    </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">_self.mousemove</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT">    </span><span class="NAME">updateColor</span><span class="PUNC">(</span><span class="NAME">ev</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT">    </span><span class="NAME">colorAccepted</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>234</span> 
<span class='line'>235</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">colormixerActive</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">color</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">targetInput.color</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>237</span> </span><span class="WHIT">          </span><span class="NAME">configProperty</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">targetInput.configProperty</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT">          </span><span class="NAME">configGroup</span><span class="WHIT">    </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">targetInput.configGroup</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT">          </span><span class="NAME">configGroupRef</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">targetInput.configGroupRef</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT">          </span><span class="NAME">prevVal</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">configGroupRef</span><span class="PUNC">[</span><span class="NAME">configProperty</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>241</span> </span><span class="WHIT">          </span><span class="NAME">newVal</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'rgba('</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">MathRound</span><span class="PUNC">(</span><span class="NAME">color.red</span><span class="WHIT">   </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">255</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">','</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT">                              </span><span class="NAME">MathRound</span><span class="PUNC">(</span><span class="NAME">color.green</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">255</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">','</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT">                              </span><span class="NAME">MathRound</span><span class="PUNC">(</span><span class="NAME">color.blue</span><span class="WHIT">  </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">255</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">','</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT">                              </span><span class="NAME">color.alpha</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">')'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>245</span> 
<span class='line'>246</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">prevVal</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">newVal</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT">        </span><span class="NAME">configGroupRef</span><span class="PUNC">[</span><span class="NAME">configProperty</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">newVal</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>248</span> </span><span class="WHIT">        </span><span class="NAME">app.events.dispatch</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">pwlib.appEvent.configChange</span><span class="PUNC">(</span><span class="NAME">newVal</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">prevVal</span><span class="PUNC">,</span><span class="WHIT"> 
<span class='line'>249</span>             </span><span class="NAME">configProperty</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">configGroup</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">configGroupRef</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>250</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>251</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>252</span> 
<span class='line'>253</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">prevTool</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>254</span> </span><span class="WHIT">      </span><span class="NAME">app.toolActivate</span><span class="PUNC">(</span><span class="NAME">prevTool</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ev</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>256</span> 
<span class='line'>257</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>259</span> 
<span class='line'>260</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>261</span>    * The &lt;code>keydown&lt;/code> event handler. This method allows the user to 
<span class='line'>262</span>    * press the &lt;kbd>Escape&lt;/kbd> key to cancel the color picking operation. By 
<span class='line'>263</span>    * doing so, the original color values are restored.
<span class='line'>264</span>    *
<span class='line'>265</span>    * @param {Event} ev The DOM Event object.
<span class='line'>266</span>    * @returns {Boolean} True if the keyboard shortcut was recognized, or false 
<span class='line'>267</span>    * if not.
<span class='line'>268</span>    */</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT">  </span><span class="NAME">this.keydown</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ev</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>270</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">prevTool</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">ev.kid_</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">'Escape'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>273</span> 
<span class='line'>274</span> </span><span class="WHIT">    </span><span class="NAME">mouse.buttonDown</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>275</span> </span><span class="WHIT">    </span><span class="NAME">app.toolActivate</span><span class="PUNC">(</span><span class="NAME">prevTool</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ev</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>276</span> 
<span class='line'>277</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>278</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>279</span> 
<span class='line'>280</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>281</span>    * The &lt;code>contextmenu&lt;/code> event handler. This method only cancels the 
<span class='line'>282</span>    * context menu.
<span class='line'>283</span>    */</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT">  </span><span class="COMM">// Unfortunately, the contextmenu event is unsupported by Opera.</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT">  </span><span class="NAME">this.contextmenu</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>288</span> 
<span class='line'>289</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>290</span>    * Store the color values from the target color input, before this tool 
<span class='line'>291</span>    * changes the colors. The previous color values are used when the user 
<span class='line'>292</span>    * decides to cancel the color picking operation.
<span class='line'>293</span>    * @private
<span class='line'>294</span>    */</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT">  </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">updatePrevColor</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>296</span> </span><span class="WHIT">    </span><span class="COMM">// If the color mixer panel is visible, then we store the color values from </span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT">    </span><span class="COMM">// the color mixer, instead of those from the color input object.</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">color</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">colormixerActive</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">colormixer.color</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">targetInput.color</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>299</span> 
<span class='line'>300</span> </span><span class="WHIT">    </span><span class="NAME">prevColor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>301</span> </span><span class="WHIT">      </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>302</span> </span><span class="WHIT">      </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>303</span> </span><span class="WHIT">      </span><span class="NAME">data</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT">        </span><span class="NAME">MathRound</span><span class="PUNC">(</span><span class="NAME">color.red</span><span class="WHIT">   </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">255</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>305</span> </span><span class="WHIT">        </span><span class="NAME">MathRound</span><span class="PUNC">(</span><span class="NAME">color.green</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">255</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>306</span> </span><span class="WHIT">        </span><span class="NAME">MathRound</span><span class="PUNC">(</span><span class="NAME">color.blue</span><span class="WHIT">  </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">255</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>307</span> </span><span class="WHIT">        </span><span class="NAME">color.alpha</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">255</span><span class="WHIT">
<span class='line'>308</span> </span><span class="WHIT">      </span><span class="PUNC">]</span><span class="WHIT">
<span class='line'>309</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>310</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>311</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>312</span> 
<span class='line'>313</span> </span><span class="COMM">// vim:set spell spl=en fo=wan1croqlt tw=80 ts=2 sw=2 sts=2 sta et ai cin fenc=utf-8 ff=unix:</span><span class="WHIT">
<span class='line'>314</span> 
<span class='line'>315</span> </span></pre></body></html>